package java8stream;

import java.util.Optional;

/**
 * Created by User on 2018/1/6.
 */
public class App {


    public static void main(String[] args) {

        App app = new App();

        Optional maybeString = Optional.empty();

        Object object = maybeString.map(app::a).orElse(app.run());

        System.out.println(object);

    }

    private Object a(Object o) {
        System.out.println(1);

        return 111;
    }

    private Object run() {
        System.out.println(2);
        return 122;
    }

}
